package com.arcbbs.controller;

import com.arcbbs.entity.FormBoard;
import com.arcbbs.entity.ForumArticleVo;
import com.arcbbs.mapper.FormBoardMapper;
import com.arcbbs.result.Result;
import com.arcbbs.service.FormBoardService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/board")
public class FormBoardController {
    @Resource
    private FormBoardService formBoardService;
    @Resource
    private FormBoardMapper formBoardMapper;

    @RequestMapping("/loadBoard")
    public Result loadBoard(){

        return Result.success(formBoardService.getboardtree(null));
    }
    @RequestMapping("/loadBoardbyid")
    public Result loadBoardbyid(Integer pboardId){
List<FormBoard> list=formBoardMapper.selectbyid1(pboardId);
        return Result.success(list);
    }



}
